import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/views/layout/Layout'

/** note: Submenu only appear when children.length>=1
 *  detail see  https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 **/

/**
* hidden: true                   if `hidden:true` will not show in the sidebar(default is false)
* alwaysShow: true               if set true, will always show the root menu, whatever its child routes length
*                                if not set alwaysShow, only more than one route under the children
*                                it will becomes nested mode, otherwise not show the root menu
* redirect: noredirect           if `redirect:noredirect` will no redirect in the breadcrumb
* name:'router-name'             the name is used by <keep-alive> (must set!!!)
* meta : {
    perms: ['GET /aaa','POST /bbb']     will control the page perms (you can set multiple perms)
    title: 'title'               the name show in submenu and breadcrumb (recommend set)
    icon: 'svg-name'             the icon show in the sidebar,
    noCache: true                if true ,the page will no be cached(default is false)
  }
**/
export const constantRoutes = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/views/redirect/index')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },
  {
    path: '/auth-redirect',
    component: () => import('@/views/login/authredirect'),
    hidden: true
  },
  {
    path: '/404',
    component: () => import('@/views/errorPage/404'),
    hidden: true
  },
  {
    path: '/401',
    component: () => import('@/views/errorPage/401'),
    hidden: true
  },
  {
    path: '',
    component: Layout,
    redirect: 'dashboard',
    children: [
      {
        path: 'dashboard',
        component: () => import('@/views/dashboard/index'),
        name: 'Dashboard',
        meta: { title: '首页', icon: 'el-icon-s-home', affix: true }
      }
    ]
  }
]

export const asyncRoutes = [
  {
    path: '/website',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    name: 'home',
    meta: {
      title: '官网管理',
      icon: 'chart'
    },
    children: [
      {
        path: '/website/home/banner',
        component: () => import('@/views/website/home/banner'),
        name: 'banner',
        meta: {
          perms: ['GET /website/banner/list', 'POST /website/banner/create', 'POST /website/banner/delete', 'GET /website/banner/read', 'POST /website/banner/update'],
          title: 'banner图',
          noCache: true
        }
      },
      {
        path: '/website/home/enginedownlink',
        component: () => import('@/views/website/home/enginedownlink'),
        name: 'enginedownlink',
        meta: {
          perms: ['GET /website/enginedownlink/list', 'POST /website/enginedownlink/create', 'POST /website/enginedownlink/delete', 'GET /website/enginedownlink/read', 'POST /website/enginedownlink/update'],
          title: '产品下载链接',
          noCache: true
        }
      },
      {
        path: '/website/home/bottomExplain',
        component: () => import('@/views/website/home/bottomExplain'),
        name: 'bottomExplain',
        meta: {
          perms: ['GET /website/bottom/list', 'POST /website/bottom/create', 'POST /website/bottom/delete', 'GET /website/bottom/read', 'POST /website/bottom/update'],
          title: '首页底部说明',
          noCache: true
        }
      },

      {
        path: '/website/home/productService',
        component: () => import('@/views/website/home/productService'),
        name: 'productService',
        meta: {
          perms: ['GET /website/productsservice/list', 'POST /website/productsservice/create', 'POST /website/productsservice/delete', 'GET /website/productsservice/read', 'POST /website/productsservice/update'],
          title: '产品与服务',
          noCache: true
        }
      },
      {
        path: '/website/home/youshi',
        component: () => import('@/views/website/home/youshi'),
        name: 'youshi',
        meta: {
          perms: ['GET /website/enginedownlink/list', 'POST /website/enginedownlink/create', 'POST /website/enginedownlink/delete', 'GET /website/enginedownlink/read', 'POST /website/enginedownlink/update'],
          title: '引擎优势',
          noCache: true
        }
      },
      {
        path: '/website/home/partnerShow',
        component: () => import('@/views/website/home/partnerShow'),
        name: 'partnerShow',
        meta: {
          perms: ['GET /website/showpartner/list', 'POST /website/showpartner/create', 'POST /website/showpartner/delete', 'GET /website/showpartner/read', 'POST /website/showpartner/update'],
          title: '合作方展示',
          noCache: true
        }
      },
      {
        path: '/website/home/contact',
        component: () => import('@/views/website/home/contact'),
        name: 'contact',
        meta: {
          perms: ['GET /website/contact/list', 'POST /website/contact/create', 'POST /website/contact/delete', 'GET /website/contact/read', 'POST /website/contact/update'],
          title: '联系方式',
          noCache: true
        }
      },
      {
        path: '/website/cms/list',
        component: () => import('@/views/website/cms/list'),
        name: 'list',
        meta: {
          perms: ['GET /website/content/list', 'POST /website/content/create', 'POST /website/content/delete', 'GET /website/content/read', 'POST /website/content/update'],
          title: '内容列表',
          noCache: true
        }
      },
      {
        path: '/website/cms/create',
        component: () => import('@/views/website/cms/create'),
        name: 'create',
        meta: {
          perms: ['GET /website/content/list', 'POST /website/content/create', 'POST /website/content/delete', 'GET /website/content/read', 'POST /website/content/update'],
          title: '创建内容',
          noCache: true
        },
        hidden: true
      },
      {
        path: '/website/cms/edit',
        component: () => import('@/views/website/cms/edit'),
        name: 'edit',
        meta: {
          perms: ['GET /website/content/list', 'POST /website/content/create', 'POST /website/content/delete', 'GET /website/content/read', 'POST /website/content/update'],
          title: '编辑内容',
          noCache: true
        },
        hidden: true
      },
      {
        path: '/website/product/purchaseList',
        component: () => import('@/views/website/product/purchaseList'),
        name: 'list',
        meta: {
          perms: ['POST /website/purchase/update', 'GET /website/purchase/read', 'POST /website/purchase/delete', 'POST /website/purchase/create', 'GET /website/purchase/list'],
          title: '产品购买类型',
          noCache: true
        }
      },
      {
        path: '/website/product/purchasedetails',
        component: () => import('@/views/website/product/purchasedetails'),
        name: 'list',
        meta: {
          perms: ['POST /website/purchasedetails/update', 'GET /website/purchasedetails/read', 'POST /website/purchasedetails/delete', 'POST /website/purchasedetails/create', 'GET /website/purchasedetails/list'],
          title: '产品购买详情',
          noCache: true
        }
      },
      {
        path: '/website/join/list',
        component: () => import('@/views/website/join/list'),
        name: 'list',
        meta: {
          perms: ['GET /website/joinus/list', 'POST /website/joinus/create', 'POST /website/joinus/delete', 'GET /website/joinus/read', 'POST /website/joinus/update'],
          title: '工作列表',
          noCache: true
        }
      },
      {
        path: '/website/join/create',
        component: () => import('@/views/website/join/create'),
        name: 'create',
        meta: {
          perms: ['GET /website/joinus/list', 'POST /website/joinus/create', 'POST /website/joinus/delete', 'GET /website/joinus/read', 'POST /website/joinus/update'],
          title: '创建工作',
          noCache: true
        },
        hidden: true
      },
      {
        path: '/website/join/edit',
        component: () => import('@/views/website/join/edit'),
        name: 'edit',
        meta: {
          perms: ['GET /website/joinus/list', 'POST /website/joinus/create', 'POST /website/joinus/delete', 'GET /website/joinus/read', 'POST /website/joinus/update'],
          title: '编辑工作',
          noCache: true
        },
        hidden: true
      },
      {
        path: '/website/topic/topicList',
        component: () => import('@/views/website/topic/topicList'),
        name: 'topicList',
        meta: {
          perms: ['GET /website/topic/list', 'POST /website/topic/create', 'POST /website/topic/delete', 'POST /website/topic/update', 'POST /website/topic/updateshowuser', 'POST /website/topic/updategone', 'POST /website/topic/createshowuser', 'POST /website/topic/creategone'],
          title: '专题页管理',
          noCache: true
        }
      },


    ]
  },
  {
    path: '/version',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    name: 'version',
    meta: {
      title: '版本库管理',
      icon: 'chart'
    },
    children: [
      {
        path: 'goods/list',
        component: () => import('@/views/version/goods/list'),
        name: 'goodsList',
        meta: {
          perms: ['POST /version/versioncontent/update', 'GET /version/versioncontent/read', 'POST /version/versioncontent/delete', 'POST /version/versioncontent/create', 'GET /version/versioncontent/list', 'POST /version/displaytype/update', 'GET /version/displaytype/read', 'POST /version/displaytype/delete', 'POST /version/displaytype/create', 'GET /version/displaytype/list'],
          title: '版本列表',
          noCache: true
        }
      },
      {
        path: 'goods/create',
        component: () => import('@/views/version/goods/create'),
        name: 'goodsCreate',
        meta: {
          perms: ['POST /version/versioncontent/update', 'GET /version/versioncontent/read', 'POST /version/versioncontent/delete', 'POST /version/versioncontent/create', 'GET /version/versioncontent/list', 'POST /version/displaytype/update', 'GET /version/displaytype/read', 'POST /version/displaytype/delete', 'POST /version/displaytype/create', 'GET /version/displaytype/list'],
          title: '新增版本',
          noCache: true
        }
      },
      {
        path: 'goods/edit',
        name: 'GoodsEdit',
        component: () => import('@/views/version/goods/edit'),
        meta: {
          perms: ['POST /version/versioncontent/update', 'GET /version/versioncontent/read', 'POST /version/versioncontent/delete', 'POST /version/versioncontent/create', 'GET /version/versioncontent/list', 'POST /version/displaytype/update', 'GET /version/displaytype/read', 'POST /version/displaytype/delete', 'POST /version/displaytype/create', 'GET /version/displaytype/list'],
          title: '修改版本',
        },
        hidden: true
      },

      {
        path: 'category/list',
        component: () => import('@/views/version/category/list'),
        name: 'categoryList',
        meta: {
          perms: ['POST /version/versioncontent/update', 'GET /version/versioncontent/read', 'POST /version/versioncontent/delete', 'POST /version/versioncontent/create', 'GET /version/versioncontent/list', 'POST /version/displaytype/update', 'GET /version/displaytype/read', 'POST /version/displaytype/delete', 'POST /version/displaytype/create', 'GET /version/displaytype/list'],
          title: '类别列表',
          noCache: true
        }
      },
      {
        path: 'category/create',
        component: () => import('@/views/version/category/create'),
        name: 'categoryCreate',
        meta: {
          perms: ['POST /version/versioncontent/update', 'GET /version/versioncontent/read', 'POST /version/versioncontent/delete', 'POST /version/versioncontent/create', 'GET /version/versioncontent/list', 'POST /version/displaytype/update', 'GET /version/displaytype/read', 'POST /version/displaytype/delete', 'POST /version/displaytype/create', 'GET /version/displaytype/list'],
          title: '新增类别',
          noCache: true
        }
      },
      {
        path: 'category/edit',
        name: 'categoryEdit',
        component: () => import('@/views/version/category/edit'),
        meta: {
          perms: ['POST /version/versioncontent/update', 'GET /version/versioncontent/read', 'POST /version/versioncontent/delete', 'POST /version/versioncontent/create', 'GET /version/versioncontent/list', 'POST /version/displaytype/update', 'GET /version/displaytype/read', 'POST /version/displaytype/delete', 'POST /version/displaytype/create', 'GET /version/displaytype/list'],
          title: '修改类别',
        },
        hidden: true
      },

      {
        path: 'Notice/list',
        component: () => import('@/views/version/notice/list'),
        name: 'NoticeList',
        meta: {
          perms: ['POST /version/versioncontent/update', 'GET /version/versioncontent/read', 'POST /version/versioncontent/delete', 'POST /version/versioncontent/create', 'GET /version/versioncontent/list', 'POST /version/displaytype/update', 'GET /version/displaytype/read', 'POST /version/displaytype/delete', 'POST /version/displaytype/create', 'GET /version/displaytype/list'],

          title: '通知列表',
          noCache: true
        }
      },
      {
        path: 'Notice/edit',
        name: 'NoticeEdit',
        component: () => import('@/views/version/notice/edit'),
        meta: {
          perms: ['POST /version/versioncontent/update', 'GET /version/versioncontent/read', 'POST /version/versioncontent/delete', 'POST /version/versioncontent/create', 'GET /version/versioncontent/list', 'POST /version/displaytype/update', 'GET /version/displaytype/read', 'POST /version/displaytype/delete', 'POST /version/displaytype/create', 'GET /version/displaytype/list'],
          title: '修改通知',
        },
        hidden: true
      },

    ]
  },
  {
    path: '/material',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    name: 'material',
    meta: {
      title: '素材库管理',
      icon: 'chart'
    },
    children: [
      {
        path: 'category/create',
        component: () => import('@/views/material/category/create'),
        name: 'categoryCreate',
        meta: {
          perms: ['GET /souremate/classif/clist', 'POST /souremate/details/update', 'GET /souremate/classif/read', 'POST /souremate/classif/delete', 'POST /souremate/classif/create', 'GET /souremate/classif/list', 'POST /souremate/details/update', 'GET /souremate/details/read', 'POST /souremate/details/delete', 'POST /souremate/details/create', 'GET /souremate/details/list'],
          title: '新增分类',
          noCache: true
        }
      },
      {
        path: 'category/list',
        component: () => import('@/views/material/category/list'),
        name: 'categoryList',
        meta: {
          perms: ['GET /souremate/classif/clist', 'POST /souremate/details/update', 'GET /souremate/classif/read', 'POST /souremate/classif/delete', 'POST /souremate/classif/create', 'GET /souremate/classif/list', 'POST /souremate/details/update', 'GET /souremate/details/read', 'POST /souremate/details/delete', 'POST /souremate/details/create', 'GET /souremate/details/list'],
          title: '分类列表',
          noCache: true
        }
      },
      {
        path: 'goods/create',
        component: () => import('@/views/material/goods/create'),
        name: 'goodsCreate',
        meta: {
          perms: ['GET /souremate/classif/clist', 'POST /souremate/details/update', 'GET /souremate/classif/read', 'POST /souremate/classif/delete', 'POST /souremate/classif/create', 'GET /souremate/classif/list', 'POST /souremate/details/update', 'GET /souremate/details/read', 'POST /souremate/details/delete', 'POST /souremate/details/create', 'GET /souremate/details/list'],
          title: '新增素材',
          noCache: true
        }
      },
      {
        path: 'goods/list',
        component: () => import('@/views/material/goods/list'),
        name: 'GoodsList',
        meta: {
          perms: ['GET /souremate/classif/clist', 'POST /souremate/details/update', 'GET /souremate/classif/read', 'POST /souremate/classif/delete', 'POST /souremate/classif/create', 'GET /souremate/classif/list', 'POST /souremate/details/update', 'GET /souremate/details/read', 'POST /souremate/details/delete', 'POST /souremate/details/create', 'GET /souremate/details/list'],
          title: '素材列表',
          noCache: false
        }
      },

      {
        path: 'goods/edit',
        name: 'GoodsEdit',
        component: () => import('@/views/material/goods/edit'),
        meta: {
          perms: ['GET /souremate/classif/clist', 'POST /souremate/details/update', 'GET /souremate/classif/read', 'POST /souremate/classif/delete', 'POST /souremate/classif/create', 'GET /souremate/classif/list', 'POST /souremate/details/update', 'GET /souremate/details/read', 'POST /souremate/details/delete', 'POST /souremate/details/create', 'GET /souremate/details/list'],
          title: '修改素材',
        },
        hidden: true
      },


      {
        path: 'category/edit',
        name: 'categoryEdit',
        component: () => import('@/views/material/category/edit'),
        meta: {
          perms: ['GET /souremate/classif/clist', 'POST /souremate/details/update', 'GET /souremate/classif/read', 'POST /souremate/classif/delete', 'POST /souremate/classif/create', 'GET /souremate/classif/list', 'POST /souremate/details/update', 'GET /souremate/details/read', 'POST /souremate/details/delete', 'POST /souremate/details/create', 'GET /souremate/details/list'],
          title: '修改分类',
        },
        hidden: true
      },
    ]
  },
  // {
  //   path: '/gameBox',
  //   component: Layout,
  //   redirect: 'noredirect',
  //   alwaysShow: true,
  //   name: 'gameBox',
  //   meta: {
  //     title: 'GM内容管理',
  //     icon: 'chart'
  //   },
  //   children: [
  //     // {
  //     //   path: '/gameBox/game/list',
  //     //   component: () => import('@/views/gameBox/game/list'),
  //     //   name: 'list',
  //     //   meta: {
  //     //     perms: ['POST /box/boxgame/ulock', 'POST /box/boxgame/update', 'GET /box/boxgame/read', 'POST /box/boxgame/delete', 'POST /box/boxgame/create', 'GET /box/boxgame/list', 'POST /box/boxgametop/update', 'GET /box/boxgametop/read', 'POST /box/boxgametop/delete', 'POST /box/boxgametop/create', 'GET /box/boxgametop/list'],
  //     //     title: '店铺列表',
  //     //     noCache: true
  //     //   }
  //     // },
  //     {
  //       path: '/gameBox/game/GMaudit',
  //       component: () => import('@/views/gameBox/game/GMaudit'),
  //       name: 'GMaudit',
  //       meta: {
  //         perms: ['POST /box/boxgame/ulock', 'POST /box/boxgame/update', 'GET /box/boxgame/read', 'POST /box/boxgame/delete', 'POST /box/boxgame/create', 'GET /box/boxgame/list', 'POST /box/boxgametop/update', 'GET /box/boxgametop/read', 'POST /box/boxgametop/delete', 'POST /box/boxgametop/create', 'GET /box/boxgametop/list'],
  //         title: '游戏审核',
  //         noCache: true
  //       }
  //     },
  //     /* 
  //     {
  //       path: '/gameBox/game/create',
  //       component: () => import('@/views/gameBox/game/create'),
  //       name: 'create',
  //       meta: {
  //         perms: ['POST /box/boxgame/ulock','POST /box/boxgame/update','GET /box/boxgame/read','POST /box/boxgame/delete','POST /box/boxgame/create','GET /box/boxgame/list','POST /box/boxgametop/update','GET /box/boxgametop/read','POST /box/boxgametop/delete','POST /box/boxgametop/create','GET /box/boxgametop/list'],
  //         title: '创建内容',
  //         noCache: true
  //       },
  //     },
  //     {
  //       path: '/gameBox/game/edit',
  //       component: () => import('@/views/gameBox/game/edit'),
  //       name: 'edit',
  //       meta: {
  //         perms: ['POST /box/boxgame/ulock','POST /box/boxgame/update','GET /box/boxgame/read','POST /box/boxgame/delete','POST /box/boxgame/create','GET /box/boxgame/list','POST /box/boxgametop/update','GET /box/boxgametop/read','POST /box/boxgametop/delete','POST /box/boxgametop/create','GET /box/boxgametop/list'],
  //         title: '编辑内容',
  //         noCache: true
  //       },
  //       hidden: true
  //     },
  //     {
  //       path: '/gameBox/game/banner',
  //       component: () => import('@/views/gameBox/game/banner'),
  //       name: 'banner',
  //       meta: {
  //         perms: ['POST /box/boxgame/ulock','POST /box/boxgame/update','GET /box/boxgame/read','POST /box/boxgame/delete','POST /box/boxgame/create','GET /box/boxgame/list','POST /box/boxgametop/update','GET /box/boxgametop/read','POST /box/boxgametop/delete','POST /box/boxgametop/create','GET /box/boxgametop/list'],
  //         title: '轮播图',
  //         noCache: true
  //       },
  //       hidden: true
  //     },*/
  //   ]
  // },
  {
    path: '/sys',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    name: 'sysManage',
    meta: {
      title: '系统管理',
      icon: 'el-icon-s-tools'
    },
    children: [
      {
        path: 'admin',
        component: () => import('@/views/sys/admin'),
        name: 'admin',
        meta: {
          perms: ['GET /admin/admin/list', 'POST /admin/admin/create', 'POST /admin/admin/update', 'POST /admin/admin/delete'],
          title: '管理员管理',
          noCache: true
        }
      },
      {
        path: 'role',
        component: () => import('@/views/sys/role'),
        name: 'role',
        meta: {
          perms: ['GET /admin/role/list', 'POST /admin/role/create', 'POST /admin/role/update', 'POST /admin/role/delete', 'GET /admin/role/permissions', 'POST /admin/role/permissions'],
          title: '角色管理',
          noCache: true
        }
      },
      {
        path: 'notice',
        component: () => import('@/views/sys/notice'),
        name: 'sysNotice',
        meta: {
          perms: ['GET /admin/notice/list', 'POST /admin/notice/create', 'POST /admin/notice/update', 'POST /admin/notice/delete'],
          title: '通知管理',
          noCache: true
        }
      },
      {
        path: 'log',
        component: () => import('@/views/sys/log'),
        name: 'log',
        meta: {
          perms: ['GET /admin/log/list'],
          title: '操作日志',
          noCache: true
        }
      },
      {
        path: 'logGm',
        component: () => import('@/views/sys/logGm'),
        name: 'logGm',
        meta: {
          perms: ['GET /admin/log/list'],
          title: 'GM操作日志',
          noCache: true
        }
      },
      {
        path: 'logUser',
        component: () => import('@/views/sys/logUser'),
        name: 'logUser',
        meta: {
          perms: ['GET /admin/log/list'],
          title: '用户操作日志',
          noCache: true
        }
      },
      {
        path: 'os',
        component: () => import('@/views/sys/os'),
        name: 'os',
        meta: {
          perms: ['GET /admin/storage/list', 'POST /admin/storage/create', 'POST /admin/storage/update', 'POST /admin/storage/delete'],
          title: '对象存储',
          noCache: true
        }
      },
      {
        path: '/sys/Advertising',
        component: () => import('@/views/sys/Advertising'),
        name: 'Advertising',
        meta: {
          perms: ['POST /admin/ad/update', 'GET /admin/ad/read', 'POST /admin/ad/delete', 'POST /admin/ad/create', 'GET /admin/ad/list'],
          title: '广告管理',
          noCache: true
        }
      },
      {
        path: '/sys/GMaudit',
        component: () => import('@/views/sys/GMaudit'),
        name: 'GMaudit',
        meta: {
          perms: ['POST /admin/realprove/examine', 'POST /admin/realprove/batchexamine', 'POST /admin/realprove/batchnoexamine', 'POST /admin/realprove/noexamine', 'GET /admin/realprove/list'],
          title: '实名审核', noCache: true
        }
      },
    ]
  },
  {
    path: '/consUser',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    name: 'consUser',
    meta: {
      title: '用户管理',
      icon: 'el-icon-s-tools'
    },
    children: [
      // {
      //   path: 'consGM',
      //   component: () => import('@/views/consUser/gm'),
      //   name: 'user',
      //   meta: {
      //     perms: ['GET /admin/user/detail', 'POST /admin/user/update', 'GET /admin/user/list'],
      //     title: 'GM用户列表',
      //     noCache: true
      //   }
      // },
      {
        path: 'consUser',
        component: () => import('@/views/consUser/user'),
        name: 'user',
        meta: {
          perms: ['GET /admin/user/detail', 'POST /admin/user/update', 'GET /admin/user/list'],
          title: '用户列表',
          noCache: true
        }
      },






    ]
  },
  {
    path: '/config',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    name: 'configManage',
    meta: {
      title: '配置管理',
      icon: 'el-icon-message-solid'
    },
    children: [
      {
        path: 'logo',
        component: () => import('@/views/config/logo'),
        name: 'configLogo',

        meta: {
          perms: ['GET /admin/config/weblog', 'POST /admin/config/weblog'],
          title: 'LOGO配置',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/profile',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    meta: {
      title: '系统配置',
      icon: 'el-icon-message-solid'
    },
    hidden: true,
    children: [
      {
        path: 'password',
        component: () => import('@/views/profile/password'),
        name: 'password',
        meta: { title: '', noCache: true }
      },
      {
        path: 'notice',
        component: () => import('@/views/profile/notice'),
        name: 'notice',
        meta: { title: '通知中心', noCache: true }
      },

    ]
    // hidden: true
  },
  { path: '*', redirect: '/404', hidden: true }
]

const createRouter = () => new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})

const router = createRouter()

// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
